package org.example.demo20240504.mq;

import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.example.demo20240504.mq.dto.OrderDTO;
import org.springframework.cloud.stream.function.StreamBridge;
import org.springframework.stereotype.Component;

/**
 * @ClassName DemoOutput
 * @Description TODO
 * @Author huarujin
 * @Date 2024/5/4 15:09
 * @Version 1.0
 */

@Component
@Slf4j
@RequiredArgsConstructor
public class DemoOutput {

    private final StreamBridge streamBridge;

    private static final String CHANNEL = "testOrder-out-0";

    public void sendMsg(OrderDTO orderDTO) {
        streamBridge.send(CHANNEL, orderDTO);
    }

}
